/**
 * the purpose of this class is to declare a car and its characters and
 * functions
 * 
 * @author Ravi
 * 
 */

public class Car {
	String color;
	String make;
	boolean startCar;
	int modelYear;

	int currentSpeed;
	int increaseSpeed;
	int decreaseSpeed;
	int tempSpeed;

	void carMake() {
		make = "Chrysler Journey";
		System.out.println("Car make is = " + make);
	}

	void carModelYear() {
		modelYear = 2009;
		System.out.println("Car Model year is = " + modelYear);
	}

	void carColor() {
		color = "Blue";
		System.out.println("Car Color is = " + color);
	}

	void start() {
		startCar = true;
		System.out.println("Car Started");
	}

	void speedUp(int increaseSpeed) {
		System.out.println("Car Current Speed is = " + currentSpeed);
		currentSpeed = currentSpeed + increaseSpeed;
		System.out.println("Current Speed after speedUp = " + currentSpeed);
		if (currentSpeed > 70) {
			System.out.println("Your car is Over speeding reduse the speed");
			tempSpeed = currentSpeed - 70;
			speedDown(tempSpeed);
			System.out.println("Now you are under permitted speed");
		}
	}

	void speedDown(int decreaseSpeed) {
		System.out.println("Car Current Speed is = " + currentSpeed);
		currentSpeed = currentSpeed - decreaseSpeed;
		System.out.println("Current Speed after speedDown = " + currentSpeed);
	}

	void stop() {
		startCar = false;
		System.out.println("Car Stopped");
	}
}
